﻿using System;
using System.Collections.Generic;
using System.Linq;

using SBPweb.PROvibe.Shared.Library.Base;

namespace SBPweb.PROvibe.Shared.Library.Components
{

    public static class ISuiteExtensions
    {

        #region ContainsId

        public static bool ContainsId(this IEnumerable<ISuite> element, int index)
        {
            return element.ContainsId<ISuite>(index);
        }

        #endregion

        #region ContainsName

        public static bool ContainsName(this IEnumerable<ISuite> element, string name)
        {
            return element.ContainsName<ISuite>(name);
        }

        #endregion

        #region ContainsVersion

        public static bool ContainsVersion(this IEnumerable<ISuite> element, Version version)
        {
            return element.ContainsVersion<ISuite>(version);
        }

        #endregion


        #region FirstById

        public static ISuite FirstById(this IEnumerable<ISuite> element, int index)
        {
            return element.FirstById<ISuite>(index);
        }

        public static TResult FirstById<TResult>(this IEnumerable<ISuite> element, int index)
            where TResult : ISuite
        {
            return element.FirstById<ISuite, TResult>(index);
        }

        #endregion

        #region FirstByName

        public static ISuite FirstByName(this IEnumerable<ISuite> element, string name)
        {
            return element.FirstByName<ISuite>(name);
        }

        public static TResult FirstByName<TResult>(this IEnumerable<ISuite> element, string name)
            where TResult : ISuite
        {
            return element.FirstByName<ISuite, TResult>(name);
        }

        #endregion

        #region FirstByVersion

        public static ISuite FirstByVersion(this IEnumerable<ISuite> element, Version version)
        {
            return element.FirstByVersion<ISuite>(version);
        }

        public static TResult FirstByVersion<TResult>(this IEnumerable<ISuite> element, Version version)
            where TResult : ISuite
        {
            return element.FirstByVersion<ISuite, TResult>(version);
        }

        #endregion


        #region WhereIdIs

        public static IEnumerable<ISuite> WhereIdIs(this IEnumerable<ISuite> element, int index)
        {
            return element.WhereIdIs<ISuite>(index);
        }

        public static IEnumerable<TResult> WhereIdIs<TResult>(this IEnumerable<ISuite> element, int index)
            where TResult : ISuite
        {
            return element.WhereIdIs<ISuite, TResult>(index);
        }

        #endregion

        #region WhereNameIs

        public static IEnumerable<ISuite> WhereNameIs(this IEnumerable<ISuite> element, string name)
        {
            return element.WhereNameIs<ISuite>(name);
        }

        public static IEnumerable<TResult> WhereNameIs<TResult>(this IEnumerable<ISuite> element, string name)
            where TResult : ISuite
        {
            return element.WhereNameIs<ISuite, TResult>(name);
        }

        #endregion

        #region WhereVersionIs

        public static IEnumerable<ISuite> WhereVersionIs(this IEnumerable<ISuite> element, Version version)
        {
            return element.WhereVersionIs<ISuite>(version);
        }

        public static IEnumerable<TResult> WhereVersionIs<TResult>(this IEnumerable<ISuite> element, Version version)
            where TResult : ISuite
        {
            return element.WhereVersionIs<ISuite, TResult>(version);
        }

        #endregion

    }

}